//
//  RecommendTableViewCell.m
//  Food
//
//  Created by dlios on 15/7/14.
//  Copyright (c) 2015年 李志远. All rights reserved.
//

#import "RecommendTableViewCell.h"
#import "UIImageView+WebCache.h"
@implementation RecommendTableViewCell

- (void)dealloc
{
    [super dealloc];
    [_img release];
    [_nameLabel release];
    [_know release];
}


- (instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier
{
    self = [super initWithStyle:style reuseIdentifier:reuseIdentifier];
    if (self) {
        self.img = [[UIImageView alloc] init];
        [self.contentView addSubview:self.img];
        
        self.nameLabel = [[UILabel alloc] init];
        self.nameLabel.font = [UIFont systemFontOfSize:17];
        [self.contentView addSubview:self.nameLabel];
        
    }
    return self;
}


- (void)layoutSubviews
{
    [super layoutSubviews];
    self.img.frame = CGRectMake(0, 0, self.contentView.frame.size.width, 130);
    self.nameLabel.frame = CGRectMake(20, 140, 200, 20);
}

- (void)setKnow:(HealthKonw *)know
{
    if (_know != know) {
        [_know release];
       _know = [know retain];
    }
    [self.img setImageWithURL:[NSURL URLWithString:know.img] placeholderImage:[UIImage imageNamed:@"placeholder"]];
    self.nameLabel.text = know.title;
    
}




- (void)awakeFromNib {
    // Initialization code
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}

@end
